#include"String.h"

void test_string1()
{
	hcm::string s1("Hello World");
	cout << s1.c_str() << endl;
	hcm::string s2;
	s2 += s1.c_str();
	cout << s2.c_str() << endl;

}

void test_string6()
{
	hcm::string s1 = "jiejie2021";
	s1.resize(15, 'm');
	cout << s1.c_str() << endl;
	std::string s2 = "jiejie2021";
	s2.resize(15, 'm');
	s2 += '\0';
	s2 += "!!!!!!";
	cout << s2.c_str() << endl;
	cout << s2 << endl;
}

void test_string2()
{
	hcm::string s1;
	cin >> s1;
	cout << s1<< endl;
	cin >> s1;
	cout << s1.c_str() << endl;
	cout << s1[1] << endl;
}

void test_string3()
{
	hcm::string s1("jiejie2021");
	hcm::string s2;
	s2 = s1;
	s2 += "das";
	cout << s2 << endl;
	s2.insert(0, 3, 'c');
	cout << s2 << endl;
	s2.erase(0, 3);
	cout << s2 << endl;
	cout << s2.find('2', 0) << endl;
}

void test_string4()
{
	hcm::string s1 = "hello";
	hcm::string s2 = "helloxxx";
	cout << (s1 > s2) << endl;
	cout << (s1 < s2) << endl;
	cout << (s1 == s2) << endl;
	cout << (s1 != s2) << endl;
	cout << (s1 >= s2) << endl;
	cout << (s1 <= s2) << endl;
}


int main()
{
	test_string3();
	//test_string1();
	//test_string6();
	//test_string2();
	//test_string4();

	return 0;
}